#include<iostream>
#include<functional>
using namespace std;

int f(int a, int b)
{
	cout << "f(int a,int b)" << endl;
	return a+b;
}

struct Functor
{
public:
	int operator()(int a, int b)
	{
		cout << "operator()(int a,int b)" << endl;
		return a+b;
	}
};

class Plus
{
public:
	static int plusi(int a, int b)
	{
		cout << "plusi(int a,int b)" << endl;
		return a+b;
	}

	double plusd(double a, double b)
	{
		cout << "plusd(double a,double b)" << endl;
		return a + b;
	}
};

int func1(int a, char c,int b)
{
	cout << c << endl;
	cout << "func1(int,char,int);" << endl;
	return a + b;
}

int main()
{
	function<int(int, int)> m = f;
	m(1, 2);
	m = Functor();
	m(1, 2);
	m = Plus::plusi;
	function<double(Plus*,double, double)> m2 = &Plus::plusd;
	m2(&Plus(),1.1, 1.1);




	function<int(int,int)> f1 = bind(func1, placeholders::_1, 'a', placeholders::_2);
	f1(1, 2);


	return 0;
}